UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1jddkr+94n1F4FGCL66RK1R1q3KSoWo+MqGZWI9FtPY='
WHERE
key_id = '5bbe36966b4bb1c751ca9adee89b7ba0800560d90bfd85c38a5df5bb7d4f0b14'
AND (
token = '1jddkr+94n1F4FGCL66RK1R1q3KSoWo+MqGZWI9FtPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)