UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zzBFWS+VL276IYNG13rX44lSfyL0c5udeYYjg3E1+jM=' 
WHERE 
  key_id = '52cf3d2fa177802c741049bde20afb3a5c4cefbc9c2415918a0d0941953355fa' 
  AND (
    token = 'zzBFWS+VL276IYNG13rX44lSfyL0c5udeYYjg3E1+jM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027