UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6guiRTOWakI1kmp9ojdm7UEJ33ge4DwlFJRxsen64GA=' 
WHERE 
  key_id = 'ab6e73dd845b796c04ea3a50169614f9bca57373e8c86c8a7c79e31b5eb63f3f' 
  AND (
    token = '6guiRTOWakI1kmp9ojdm7UEJ33ge4DwlFJRxsen64GA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041