UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TmSkiFQvIaQsJ8Y+QKXmnxvE6InXRmzTiwyDmS64nzo=' 
WHERE 
  key_id = '574e9f66ebfc00456f29dea6fa2076be29e65dd09a40fb933488947f21bc377f' 
  AND (
    token = 'TmSkiFQvIaQsJ8Y+QKXmnxvE6InXRmzTiwyDmS64nzo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015