UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ym5ChwiGjcVi4MNjOV5gh2Fu4KCwLkkisZdtzuwF6Ac='
WHERE
key_id = '283b4e1cbd62c74fb185cb01865d7e2af16ca23276fabf4e90f8530330e1abd8'
AND (
token = 'Ym5ChwiGjcVi4MNjOV5gh2Fu4KCwLkkisZdtzuwF6Ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)