UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q4mJXgWiEZgJgggZ6oY9OwndN1pqYzJat05FDeq7TAI='
WHERE
key_id = '2531b2562f926da3cc584a1bae985755e42228206374dd8b4897a1da3a509f9e'
AND (
token = 'q4mJXgWiEZgJgggZ6oY9OwndN1pqYzJat05FDeq7TAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)