UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TUa8HtVEjCu6xFlULvb8RyQCmCDhpW59a5xKvNaE4/A=' 
WHERE 
  key_id = '2ceea95c05c7ef452dfe437af4d1dad08b728e6ebebc63878f94c12638c8ba83' 
  AND (
    token = 'TUa8HtVEjCu6xFlULvb8RyQCmCDhpW59a5xKvNaE4/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042