UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1xT5wX9CnZAPVln7o+oKDM7rI04VOMqYNLBcDjW5IiQ=' 
WHERE 
  key_id = 'fb26f3761973e0fb2bb076d56c7645ac46d9ef33abccd7d8da0384dbb5647518' 
  AND (
    token = '1xT5wX9CnZAPVln7o+oKDM7rI04VOMqYNLBcDjW5IiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032