UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L974nMbDrV0PtrQ+9Lp7E+fAWsxG6w21kgAWpiyfThs='
WHERE
key_id = '03c2171ddaa1c07bb1652b8ec5529e07511437027c4809a4229fc7cd8ce3be69'
AND (
token = 'L974nMbDrV0PtrQ+9Lp7E+fAWsxG6w21kgAWpiyfThs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)