UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4mGLZgDFAZlTZZVIZcuNcFzVy8fZlNUId8285tU3A70=' 
WHERE 
  key_id = 'f7278e8ea671eeb7b5c7ba179bd2a188e7090a16257f66ebee804f9ebda27eec' 
  AND (
    token = '4mGLZgDFAZlTZZVIZcuNcFzVy8fZlNUId8285tU3A70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045