UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJPnWK1ow6IempotmOC+jf8xTnFdVWRIJ7cX5tvoXos='
WHERE
key_id = 'eb3b07ebff36fd89acd14dcb08a19c8211e766bcbc9856a0622e20dd9c28246c'
AND (
token = 'cJPnWK1ow6IempotmOC+jf8xTnFdVWRIJ7cX5tvoXos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)