UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b0lqXnq6BIYJZHT7q6a++nSfHQN7NUAhBzNHFXM/HuM='
WHERE
key_id = '2cd944a27621131541868e94b93805969d665afddb576d247cfb1047cf579aae'
AND (
token = 'b0lqXnq6BIYJZHT7q6a++nSfHQN7NUAhBzNHFXM/HuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)