UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aRlsMvJIZYtGpCXv5qHl8FY8sqRST+IuWPEoOKU0dOE='
WHERE
key_id = '8a24a04942608d29e09f44db3d5d2d82234f10bbf9e802aea62812735e78cd86'
AND (
token = 'aRlsMvJIZYtGpCXv5qHl8FY8sqRST+IuWPEoOKU0dOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)