UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TlKnLpejoXZm5p0kcpFyjqcUFJkvXxjkXwOA2T1CB0E='
WHERE
key_id = '41c576e466d0d0c035f1dde8a0ca9af5ce9edd1e9fadcf0d13d6eef61dda90e5'
AND (
token = 'TlKnLpejoXZm5p0kcpFyjqcUFJkvXxjkXwOA2T1CB0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)