UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Zdk6+NtbZE9flkLS0wjCw1kPdV+35XL4fiGpoZQ3fg='
WHERE
key_id = '37f23bb8672f1c1413f5c93b8bb2b88bcb910143e2f9d2f1bb93172886d43e98'
AND (
token = '8Zdk6+NtbZE9flkLS0wjCw1kPdV+35XL4fiGpoZQ3fg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)