UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PuTVeK3q/yJzBNciHAZkvJP7LMEyxL5qYVLNhDg1ExU='
WHERE
key_id = '198a0e974a01fe8ea20a7efa84502eaa76e9d62be60ce3db16811eae77e17874'
AND (
token = 'PuTVeK3q/yJzBNciHAZkvJP7LMEyxL5qYVLNhDg1ExU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)