UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0gE6EP/cdkE7YWUAjbu0jLxJHkuNjDKA43gMRDD07Xo='
WHERE
key_id = '42ee424825c69b73272fcd19a13de2af51c7f766ee6f17b9d461b095679c38c6'
AND (
token = '0gE6EP/cdkE7YWUAjbu0jLxJHkuNjDKA43gMRDD07Xo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)