UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pb/f3u3GwbuZmpEwfZkGhr7OTHW7q4nuZBmmiK+zDXY='
WHERE
key_id = 'a76f74fff5d222265cd0f84c6e7be9503df219a4f82fb6619dc8a528ba87c96b'
AND (
token = 'Pb/f3u3GwbuZmpEwfZkGhr7OTHW7q4nuZBmmiK+zDXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)