UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h1WWNn7TtFjsoWG2eBJDx3EeR6TcYw/TTxtU+r29vcY='
WHERE
key_id = '12ab402b0e6ad5ffbf6840c1ad946b57337e6fdf582cecca5f9e9d4e9fd6e8a5'
AND (
token = 'h1WWNn7TtFjsoWG2eBJDx3EeR6TcYw/TTxtU+r29vcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)