UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pvB5Cgu4byYwMjzHh/H0Q9oJaWhk4+9sINHJoC0E7ks='
WHERE
key_id = '5b7d1a8afabecb336ce1da9eff73f5cad47b7be2cfb25b8198263fa8666a2202'
AND (
token = 'pvB5Cgu4byYwMjzHh/H0Q9oJaWhk4+9sINHJoC0E7ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)