UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gtZZTtjvjd5u7b1Xp73XgKmGz+ki93el7CkAGyG/yKc='
WHERE
key_id = '85a779bff27feb2e3cbaef1dcea4d0d642f9cb7b7040ef0ec8e9a1faef402176'
AND (
token = 'gtZZTtjvjd5u7b1Xp73XgKmGz+ki93el7CkAGyG/yKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)