UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yf264q9FIaOkL6jKi6XSzLx4QFR5BlLvyy26DWUK6Ik='
WHERE
key_id = '89109476244d5b59a9d2b3c51d4528ac3d422becff865a9e3d385fd06b4374da'
AND (
token = 'Yf264q9FIaOkL6jKi6XSzLx4QFR5BlLvyy26DWUK6Ik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)