UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '83FkiMgW3mNAbsDpfNATdT1yX2jvs0sbIWdbqEuwDeU=' 
WHERE 
  key_id = 'd6188ee9ed3f3a837db72c7be7e62c7a165b6629280b10443500eff5235f38fd' 
  AND (
    token = '83FkiMgW3mNAbsDpfNATdT1yX2jvs0sbIWdbqEuwDeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015