UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZP5IpbQJF8oVKNMGQQ3wD820V8IZmznAmhG9uh3JUQ4='
WHERE
key_id = '56f68dbb2b23573f9fadabe0f180bffadf2f0e3595c02be01bfaec800d0e3aa1'
AND (
token = 'ZP5IpbQJF8oVKNMGQQ3wD820V8IZmznAmhG9uh3JUQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)