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

Query time 0.00032