UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jmPYtAn91NL3nuzACeaXU0BBMN6nmp8nRUqWNMn8mUo='
WHERE
key_id = '4656ec707d6f6dc042c40d6028ef04b13e883b7ad336ccff77960a251da1f6fb'
AND (
token = 'jmPYtAn91NL3nuzACeaXU0BBMN6nmp8nRUqWNMn8mUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)