UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pfDukPH1EoBwPvCXDlGSoFW3IosHhmLr+ueyhCugq00=' 
WHERE 
  key_id = '2f9081426cb2c709004c20e7ac9941fe4a4e79ac8e390ba2d8395f3450bf0907' 
  AND (
    token = 'pfDukPH1EoBwPvCXDlGSoFW3IosHhmLr+ueyhCugq00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037