UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FGzoPd3VUc0hmKRgYr2OJ6mnp9NsuqR8kh2V01jcU3A='
WHERE
key_id = '4668695033e250de21bbd01d49a0879eecca6efe681e32551dfac7eed6ab71de'
AND (
token = 'FGzoPd3VUc0hmKRgYr2OJ6mnp9NsuqR8kh2V01jcU3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)