UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nsFkpxaxoaWJXo/+l4FVMtc50tJTDoRtZCL0yMKvP5Q='
WHERE
key_id = 'f6e82d2bc919bc2473a2b8fc8676274414dcb2e04f569ed73fbc917a024e4cc4'
AND (
token = 'nsFkpxaxoaWJXo/+l4FVMtc50tJTDoRtZCL0yMKvP5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)