UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oPzcJR8ATMtPES/w4qn79AIPMKnbX+c+Hu6IXPZe2A='
WHERE
key_id = 'c0e1505a6f81718b33b6f06a39bf39d22fdb1a7ae54274df12fde100f7a842a8'
AND (
token = '2oPzcJR8ATMtPES/w4qn79AIPMKnbX+c+Hu6IXPZe2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)