UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tTb/pZ7skZf2Hgs9xAbzt4kYSEoqRk9XG2wOFPJyFsc='
WHERE
key_id = '02ce3e7a91641dd439fca337be077aec4eb4a0fc7fda4d4ce3eb729819c9e138'
AND (
token = 'tTb/pZ7skZf2Hgs9xAbzt4kYSEoqRk9XG2wOFPJyFsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)