UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k2L3/eR8dimqi9T4CHoltvS7etZTzBXVwAyIJDZs0fs=' 
WHERE 
  key_id = '4c7f02c9cc2b2c399286510a4ad6ea81deb50a94770447866039c8cf33fbbf6e' 
  AND (
    token = 'k2L3/eR8dimqi9T4CHoltvS7etZTzBXVwAyIJDZs0fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039