UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f000pOwdR0J/hi614RRpJfTiSob9UUgDfirn22A33jw=' 
WHERE 
  key_id = '4ab5324f84f8898f55fe480dc8fc93f9a72c1c3b9d6331e14d67fadf395a09f0' 
  AND (
    token = 'f000pOwdR0J/hi614RRpJfTiSob9UUgDfirn22A33jw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043