UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D9Z24UCxGUhjGXt/omyP+CiH6Fzbxtwilmzx3ymqYUo='
WHERE
key_id = 'fe89b40ba430f0b5c5519af632884393fcccfbc682c5a0335a7c7c4c8cf5c3b2'
AND (
token = 'D9Z24UCxGUhjGXt/omyP+CiH6Fzbxtwilmzx3ymqYUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)