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

Query time 0.00032