UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'McOpsbbVVxQnxAOxQLF2MEtf0Zeyew3RJCmLhEgUsSc='
WHERE
key_id = '714cb59dbe3886ff05ff7c6a8a19a382426ddce491cbdf247bc2a17aea106502'
AND (
token = 'McOpsbbVVxQnxAOxQLF2MEtf0Zeyew3RJCmLhEgUsSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)