UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'leMrtJyl+YWcWsOMmpMpRPoBW81eiJxWFKG+Tpw6gog='
WHERE
key_id = '4cdf4ad4da6813651237d5e157096efc3549a736e777020ca1d8a70e53ddf53f'
AND (
token = 'leMrtJyl+YWcWsOMmpMpRPoBW81eiJxWFKG+Tpw6gog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)