UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+/N061kjBGec5ZYFN1YnEbt87pIie5x95YfoXrYK1fY=' 
WHERE 
  key_id = '3a46968493ac386db604aaa49c3fce684090745d474ef96c2bef766924fcd48c' 
  AND (
    token = '+/N061kjBGec5ZYFN1YnEbt87pIie5x95YfoXrYK1fY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031