UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H578WRumNo3UnlsXOYP9kogR5ZRGJ7j8GuUnuSoEyQ0=' 
WHERE 
  key_id = 'de7ad68e67e54e271cd04993d104b9bc48b2ddc75ea9f770ed164b4b9aa4d9c9' 
  AND (
    token = 'H578WRumNo3UnlsXOYP9kogR5ZRGJ7j8GuUnuSoEyQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031