UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DfIWLUjBWTdbQlPS/KLDPz7wPCH1vfJKl/NY2gbCECw=' 
WHERE 
  key_id = '44ed4e5db3a3e795d390184071d375136d1335f814b55f8af332e4b3cbed9cab' 
  AND (
    token = 'DfIWLUjBWTdbQlPS/KLDPz7wPCH1vfJKl/NY2gbCECw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024