UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PTXGtpM0Xj+F+SuBbXqZxya6EzNSZDN9cd3MDpXuST0='
WHERE
key_id = '7bbb0a66bf9701dbbdf3db9265aebde8b3c67ef2991a59a7896ceca2683264c5'
AND (
token = 'PTXGtpM0Xj+F+SuBbXqZxya6EzNSZDN9cd3MDpXuST0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)