UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7y02RGBQYAGO5xr9e5WKxBPFN77EYtNn7LGonFm/Bzo=' 
WHERE 
  key_id = '68aca62bc2851efb20b1a59082ae637b23f7f95c64e1f97888c4781606620a4a' 
  AND (
    token = '7y02RGBQYAGO5xr9e5WKxBPFN77EYtNn7LGonFm/Bzo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048