UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HzVFXL+o7Tho4oqZeKnew/sYBLi6FZvxxGB1NJ3f8FU='
WHERE
key_id = '5a9eae7411d0a24c39c05c74ed461aad5fd1c45570d5f401a0ab7bf8039db00a'
AND (
token = 'HzVFXL+o7Tho4oqZeKnew/sYBLi6FZvxxGB1NJ3f8FU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)