UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KlsYDKr8JwU2gVlf6rbyKxWBkqOoLPHBV0PUfPun5Yk='
WHERE
key_id = 'a6fdb3683307f4c352c15c72cc088b564c6b34766c137a4ce2d554bd26ec6bf2'
AND (
token = 'KlsYDKr8JwU2gVlf6rbyKxWBkqOoLPHBV0PUfPun5Yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)